package com.mojo.concurrent.lock;

/**
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class LockSafe {
    public static void main(String[] args) {
        //RunnableImpl runnable = new RunnableImpl();
        //Thread thread1 = new Thread(runnable);
        //Thread thread2 = new Thread(runnable);
        //Thread thread3 = new Thread(runnable);
        //thread1.start();
        //thread2.start();
        //thread3.start();
        //lock锁示例
        //ReadAndWriteLock示例
        ReadAndWriteLock01 lock01 = new ReadAndWriteLock01();
        new Thread(() -> {

            lock01.testReadWrite();
        }, "线程1").start();
        new Thread(() -> {
            lock01.testReadWrite();
        }, "线程2").start();
        //Condition接口使用示例
    }
}
